<?php
$index = strrpos($_SERVER['SCRIPT_FILENAME'],'/');
$dir = substr ($_SERVER['SCRIPT_FILENAME'],0,$index);
$dir = str_replace($_SERVER['DOCUMENT_ROOT'],'',$dir);
include_once("libs/SmartyBC.class.php");
$smarty=new SmartyBC();
$smarty->template_dir = $_SERVER['DOCUMENT_ROOT']."/templates/";
$smarty->compile_dir = $_SERVER['DOCUMENT_ROOT'].'/templates_c'.$dir;
$smarty->cache_dir = $_SERVER['DOCUMENT_ROOT'].'/cache/'.$dir;
$smarty->left_delimiter = '{{';
$smarty->right_delimiter = '}}';
//if($_SERVER['SCRIPT_NAME'] != '/index.php' && $_SERVER['SCRIPT_NAME'] != '/' && $_SERVER['SCRIPT_NAME'] != '/login.php') {
	require_once $_SERVER['DOCUMENT_ROOT'] . '/class/db.class.php';
	/*$info = $db->query_first("SELECT * FROM ip_info WHERE `ip`='".$_SERVER['REMOTE_ADDR']."' LIMIT 1");
	if (!$info || $info['time']+60*60*12 < time()) {
		header('Location: /index_empower.html');
		exit();	
	}*/
//}
//$smarty->assign('code_url',$code_url);
?>